UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WaRfwWCpFm8eNOiVu8YDe+mQTNZH+xC8LwULitrA9D0=' 
WHERE 
  key_id = '10ab6bfe542883e9b6bd434d01f5ea0e7299db7b0a00a5ab1b9b407bdd4ff052' 
  AND (
    token = 'WaRfwWCpFm8eNOiVu8YDe+mQTNZH+xC8LwULitrA9D0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037