UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/AYYTYEejLSnYzmiv0Lo+uWJkM8GK4JjPOMRu/tJTEI=' 
WHERE 
  key_id = '664a0b79e4a53f0a0ee8df2ee3f028c292434a941d603c6d7cef4f50cb5daf0c' 
  AND (
    token = '/AYYTYEejLSnYzmiv0Lo+uWJkM8GK4JjPOMRu/tJTEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025