UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VZ1sZlZQ+90LUoNN+PWI4KQyuHzIOwjHViUs/hat43U=' 
WHERE 
  key_id = '2afae11bf6436861f762ffb67c845c94f0044cb8ad6d22a80e9767b1b3db1e54' 
  AND (
    token = 'VZ1sZlZQ+90LUoNN+PWI4KQyuHzIOwjHViUs/hat43U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022