UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FAYY9/wm5yEzuf0JcLnOhPryceMRBQGTWAmg8S4VcZQ=' 
WHERE 
  key_id = '26483f89e221c118572f02e30b2d368bac675f91db2d058e367a3ea3dfae9539' 
  AND (
    token = 'FAYY9/wm5yEzuf0JcLnOhPryceMRBQGTWAmg8S4VcZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030