UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jen3nVeYx8ozu+Y1d7JIKGMaPayZs42NWCYWbrBFYAA=' 
WHERE 
  key_id = 'f4b878ce1bd446a70c28b8637bf451f85af35334906f96e40e5d74495bd99ff4' 
  AND (
    token = 'jen3nVeYx8ozu+Y1d7JIKGMaPayZs42NWCYWbrBFYAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055