UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZuC55qA6+Jl6g+++tioqtvfafnD9YXMtYb/O8c1rnM0=' 
WHERE 
  key_id = '9c0c173d626428658f70cedf5fa1c22b1e28ca49951bad08f358d4933610bcc2' 
  AND (
    token = 'ZuC55qA6+Jl6g+++tioqtvfafnD9YXMtYb/O8c1rnM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031