UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ckmfo+lpPChZCz0w5VF2f2vZT7BS6OqptL+QXjwmvTM=' 
WHERE 
  key_id = 'b754cecb82f64780fa2f4fd9e85fd5844f84577dbaeda2497c94f9149f21eabe' 
  AND (
    token = 'Ckmfo+lpPChZCz0w5VF2f2vZT7BS6OqptL+QXjwmvTM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058