UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lRlj1Xi1Lb3IoRmZty4AasxOrZXn9BfTJOY2qmlR9Wc=' 
WHERE 
  key_id = '2f7d67bad7c371d9f66db4381116981ddcc8e3325757a24650e1b99578480aee' 
  AND (
    token = 'lRlj1Xi1Lb3IoRmZty4AasxOrZXn9BfTJOY2qmlR9Wc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041