UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'blR5CN5NP/KLRXCbp/zJrJBr5LtSrv7rG8IyDrXHs7w=' 
WHERE 
  key_id = 'd25760947649644c589b5a9eee5cdc55d1316149bc3de40b9370873af241d68e' 
  AND (
    token = 'blR5CN5NP/KLRXCbp/zJrJBr5LtSrv7rG8IyDrXHs7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050