UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1cGvJ5rBemQfIbgKmnC8xWLdjMOBd00ShSPgzdgnlnY=' 
WHERE 
  key_id = 'e74d36feb73641d0c497c03768ed0e8b27e639674e26787c47bb2f777824b93e' 
  AND (
    token = '1cGvJ5rBemQfIbgKmnC8xWLdjMOBd00ShSPgzdgnlnY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018