UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4h5um2u/RiHwHPOHXh9whS0sRDDHsps1Px+k6M8CEDk=' 
WHERE 
  key_id = '194565a2ec398118a00719b9236740edc5029650150189a6da6d29b2c06d02d0' 
  AND (
    token = '4h5um2u/RiHwHPOHXh9whS0sRDDHsps1Px+k6M8CEDk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032