UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n4HhF0EQRxLbEja/+VSpchBfZDOxiKTFolVY9jqxgas=' 
WHERE 
  key_id = 'fba9ce3e84b19899f2dfb109f443c34290bfd3c90b242faec39e6e1abceb4eed' 
  AND (
    token = 'n4HhF0EQRxLbEja/+VSpchBfZDOxiKTFolVY9jqxgas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040