UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'skXfGVd4PV3b9vHAkkEbUhuBMT/xELxqw2M8ua0j2Oo=' 
WHERE 
  key_id = '9c6a22b09fd761ffa2975a2a36abe43e1f4659d1b539bfc0e9ae93e2082212f1' 
  AND (
    token = 'skXfGVd4PV3b9vHAkkEbUhuBMT/xELxqw2M8ua0j2Oo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069