UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v7DO7RhtlC1Gn25xiQw7uIi3cL4iI/+7t7PNRke232o=' 
WHERE 
  key_id = '47917b4a8dd2a15e0dc17194add920d11a835936814f0ee9d09ae5b477e6a087' 
  AND (
    token = 'v7DO7RhtlC1Gn25xiQw7uIi3cL4iI/+7t7PNRke232o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042