UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9/rHnLXt8qNAc/xtqO8GF2ucKYOhwQ3Z/ChX0UnNuoA=' 
WHERE 
  key_id = '4296e4249f1f7753f1502cc7e0c97ec5a3df9e3e260c4b1d0e295630bed90201' 
  AND (
    token = '9/rHnLXt8qNAc/xtqO8GF2ucKYOhwQ3Z/ChX0UnNuoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038