UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aYM+lCCiDuGZZHkm4Rkbv5/xDTFM6kBpdd0tazCOSuw=' 
WHERE 
  key_id = 'b2e33471c526a4ee6e2b78be5340e0e992c1a28cbc18f71ed2872fdeaf2c7915' 
  AND (
    token = 'aYM+lCCiDuGZZHkm4Rkbv5/xDTFM6kBpdd0tazCOSuw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028