UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mlDVmAfJoe8Qx6bF/rDYGKEZ1u3sXMAYdTYQhBX8+Sc=' 
WHERE 
  key_id = '38027e7365ce13329ba998bcc5404d191d4169c46c5563d1797f5e510cd3ccff' 
  AND (
    token = 'mlDVmAfJoe8Qx6bF/rDYGKEZ1u3sXMAYdTYQhBX8+Sc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040