UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F/osg9g1zvz27OkWuAizi+F7c4chdqu3HQOauIWbZQM=' 
WHERE 
  key_id = '63f8ec0df21868c8e173a0ffd7ce27a348cf913135fd0a70ae411fecc7124e59' 
  AND (
    token = 'F/osg9g1zvz27OkWuAizi+F7c4chdqu3HQOauIWbZQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041