UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f3989zjfbdks9l1rKHKULJUFE/BB+N/NAXOXD5+81KQ=' 
WHERE 
  key_id = '468e9fa802fe7d87ff833485e6beef332ec4e22b48ab9d8418956e3473a67a41' 
  AND (
    token = 'f3989zjfbdks9l1rKHKULJUFE/BB+N/NAXOXD5+81KQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031