UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DFf8Wpo9bXlDepo+u57dVN5gNYnffmSlnFRTn6GgmWo=' 
WHERE 
  key_id = 'eb114a3aa574677b9f7af54f90af98498fc06c865396dc48a261824814629ca8' 
  AND (
    token = 'DFf8Wpo9bXlDepo+u57dVN5gNYnffmSlnFRTn6GgmWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029