UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TSr3vQO+zqWfsR/e8Nq422YnblXXlNiNVliMSWK5iwQ=' 
WHERE 
  key_id = '7f79d11518939e6602e7d7b3375096e5c165c8c6e84a22ca8e6e634572bccd5b' 
  AND (
    token = 'TSr3vQO+zqWfsR/e8Nq422YnblXXlNiNVliMSWK5iwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036