UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vu7S3oM8ACa7ItBTMtFSqjzTFCr6UJKEUhhgLT5XXU4=' 
WHERE 
  key_id = '11b19edee4565c3eb3d13c8e67dd5fa17d5a15b13962ca47ddbe434fcd408470' 
  AND (
    token = 'Vu7S3oM8ACa7ItBTMtFSqjzTFCr6UJKEUhhgLT5XXU4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048