UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2ni27wa42RPP1gnzvsFQ6CN0FgGdNCKUjKcuc7/IRjY=' 
WHERE 
  key_id = 'af77bc8c4a26da50a07493657c29aca58ed073cff591f7ede4fdbf1948b2d757' 
  AND (
    token = '2ni27wa42RPP1gnzvsFQ6CN0FgGdNCKUjKcuc7/IRjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049