UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pvxLrB9cNVF0jxuD7niLPyRgKncNbLTlyeppwMZEEWw=' 
WHERE 
  key_id = '6b7dddb6aa203fbf5c4274e477c4bd5ddcf84707e17e8c2265a2225bc8b73016' 
  AND (
    token = 'pvxLrB9cNVF0jxuD7niLPyRgKncNbLTlyeppwMZEEWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029