UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mbdAxnie9e+2DURkF4cdbqJBAPALvbZYSgHIZkN9JjE=' 
WHERE 
  key_id = '4eeaee63e2eff07c366206a9a35032b3ba059d4981371cfc818d36d99f54b9ae' 
  AND (
    token = 'mbdAxnie9e+2DURkF4cdbqJBAPALvbZYSgHIZkN9JjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035