UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ItCE++QB48qN1r2jydpJbKJyIQIy2beGGi/0CuSkeWw=' 
WHERE 
  key_id = '5a08cf9d294e2095e81f737d9b0e36f446b568a1b5118a2b6dea6d42041b3141' 
  AND (
    token = 'ItCE++QB48qN1r2jydpJbKJyIQIy2beGGi/0CuSkeWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041