UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VNf1z2Jr3khEi6esMgT/vDkWWAyHzqzzsUjCMxzfKfA=' 
WHERE 
  key_id = 'aea3ecf3cb2f77194d85daf3da1efdd35244992a6e589e7d5a7d83d7d0bf608c' 
  AND (
    token = 'VNf1z2Jr3khEi6esMgT/vDkWWAyHzqzzsUjCMxzfKfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029