UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LLDaoHmQZwum2JlZZLsenm5XQWg/WXqZb3aC+p6+yCY=' 
WHERE 
  key_id = '37562aca467da1b4f038bbb4897715f286c2b4f565123d86f6db62fa7dc887d3' 
  AND (
    token = 'LLDaoHmQZwum2JlZZLsenm5XQWg/WXqZb3aC+p6+yCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017