UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TWtVc7rxTzO7TniaujcZoWGZmlL/8/ZOv4FqNDaSCmE=' 
WHERE 
  key_id = '4602a7c598fda6cdc1014ec32ad28947c57f09ed02f4262159e24f4598f71768' 
  AND (
    token = 'TWtVc7rxTzO7TniaujcZoWGZmlL/8/ZOv4FqNDaSCmE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018