UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NSznsS76E2ClUszRwPTQSdLvoHIcIq/hFAkCeO7cAPU=' 
WHERE 
  key_id = 'd2fb914e988f1f3843399e2e8d6e896cace7d05dea2e38a9f227ce6b1be0119f' 
  AND (
    token = 'NSznsS76E2ClUszRwPTQSdLvoHIcIq/hFAkCeO7cAPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048