UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '49n2dLZl3Sc/CbFWUMzlsiQMLWkDV0YogNXT2pL0GJU=' 
WHERE 
  key_id = '55000e8db4a96705e8e9c301e712c5f3f3bd6d232a4516210ef2521775ce7526' 
  AND (
    token = '49n2dLZl3Sc/CbFWUMzlsiQMLWkDV0YogNXT2pL0GJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037