UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XchKfoZC+d54Pcvf+g5mg1LwbLq6u4687yVfu/sJyGY=' 
WHERE 
  key_id = '4b4ac7caf7175e7f7724eb6e9992d180f86d793e7199328388e809a930f1006a' 
  AND (
    token = 'XchKfoZC+d54Pcvf+g5mg1LwbLq6u4687yVfu/sJyGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )