UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wTXTx8RH470q2sUd4B747P8/mmdQYx8jFzhu5P7CKYk=' 
WHERE 
  key_id = '7ef69cecd9b2ef325c7c37be6596d3bc343939eea39977546e3948c9996737a4' 
  AND (
    token = 'wTXTx8RH470q2sUd4B747P8/mmdQYx8jFzhu5P7CKYk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057